package com.ang.enums.t3;

import com.alibaba.fastjson.JSONObject;

import java.util.Arrays;

public class SexEnum3Test {
    public static void main(String[] args) {

        test();
    }

    public static void test(){
        SexEnum3[] values = SexEnum3.MALE.values();
        System.out.println("------------values");
        Arrays.stream(values).forEach(sex->{
            System.out.println(sex.toString());
        });

        System.out.println("------------compareTo");
        System.out.println(SexEnum3.MALE.compareTo(SexEnum3.FEMALE));
        System.out.println(SexEnum3.UNKNOWN.compareTo(SexEnum3.FEMALE));

        System.out.println("------------equals");
        System.out.println(SexEnum3.MALE.equals(SexEnum3.FEMALE));
        System.out.println(SexEnum3.MALE.equals(SexEnum3.MALE));

        System.out.println("------------name");
        System.out.println(SexEnum3.MALE.name());
        System.out.println(SexEnum3.FEMALE.name());

        System.out.println("------------name");
        System.out.println(SexEnum3.MALE.ordinal());
        System.out.println(SexEnum3.FEMALE.ordinal());
        System.out.println(SexEnum3.UNKNOWN.ordinal());

        System.out.println("------------valueOf");
        SexEnum3 unknown = SexEnum3.UNKNOWN.valueOf("UNKNOWN");
        System.out.println(unknown);
        SexEnum3 male = SexEnum3.MALE.valueOf(SexEnum3.class, "MALE");
        System.out.println(male);
    }
}
